<div class="panel panel-default">
	<div class="panel-heading">
		基本配置
	</div>
	<div class="panel-body">
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">是否启用</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				<div class="input-group">
					<label class="radio-inline">
						<input type="radio" name="base[open]" value="1" {if $setting['base']['open']}checked{/if}> 是
					</label>
					<label class="radio-inline">
						<input type="radio" name="base[open]" value="0" {if !$setting['base']['open']}checked{/if}> 否
					</label>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">排行榜尾巴</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				<div class="input-group">
					<label class="radio-inline">
						<input type="radio" name="base[show_footer]" value="1" {if $setting['base']['show_footer']}checked{/if}> 显示
					</label>
					<label class="radio-inline">
						<input type="radio" name="base[show_footer]" value="0" {if !$setting['base']['show_footer']}checked{/if}> 不显示
					</label>
				</div>
				<span class="help-block">
					排行榜页面底部是否显示公众号名称、关注链接、二维码，可有效引导粉丝关注公众号
					&nbsp;&nbsp;<a href="{php echo url('account/post/list', array('uniacid' => $_W['uniacid']))}" target="_blank">立即去设置</a>
				</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">是否开启幸运码</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				<div class="input-group">
					<label class="radio-inline">
						<input type="radio" name="base[luckycode]" value="1" {if $setting['base']['luckycode']}checked{/if}> 是
					</label>
					<label class="radio-inline">
						<input type="radio" name="base[luckycode]" value="0" {if !$setting['base']['luckycode']}checked{/if}> 否
					</label>
				</div>
				<span class="help-block">开启后，签到提示语可使用{lucky_code}变量，每人每天签到可领取一次幸运码</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">幸运码初始值</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				<input type="text" class="form-control" name="base[luckystart]" value="{php echo $setting['base']['luckystart']}" />
				<span class="help-block">设置幸运码的初始值，幸运码会在初始值的基础上自增，只能为无符号的数字整型，例如12333，仅在首次提交中有效，请谨慎填写</span>
			</div>
		</div>
		{if $setting['base']['sign_count'] > 0}
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">签到次数限制</label>
			<div class="col-sm-4">
				<div class="input-group">
					<input type="text" class="form-control" name="base[sign_count]" value="{php echo $setting['base']['sign_count']}" />
					<span class="input-group-addon">次/天</span>
				</div>
				<span class="help-block">支持每天签到多次，同一天内设置多次签到，不触发连续签到奖励</span>
			</div>
		</div>
		{/if}
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">可签到时间</label>
			<div class="col-sm-6">
				<div class="input-group">
					<input placeholder="开始时间" type="text" class="form-control" name="base[start]" value="{php echo $setting['base']['start']}" />
					<div class="input-group-addon"> 至 </div>
					<input placeholder="结束时间" type="text" class="form-control" name="base[end]" value="{php echo $setting['base']['end']}" />
					<div class="input-group-addon">点</div>
				</div>
				<span class="help-block">设置可签到的24小时制时间段（整数0-23），不限制时间则填为空</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">手机端排行榜链接</label>
			<div class="col-sm-8 col-xs-12">
			{if $rid == 0}
				<p class="form-control-static">创建规则成功后显示链接</p>
			{else}
				<p class="form-control-static">{php echo $this->createMobileUrl('home', array('rid'=>$rid))}</p><a target="_blank" class="btn btn-default" role="button" href="{$_W['siteroot']}app/{php echo $this->createMobileUrl('home', array('rid'=>$rid))}" >打开链接</a>
			{/if}
                <p class="form-control-static">
                    {php $url=$_W['siteroot'].'app/'.$this->createMobileUrl('home', array('rid'=>$rid))}
                    <img src="{php echo $this->createWebUrl('qrcode', array('content' => urlencode($url)))}" style="width:150px; height: 150px;">
                </p>
            </div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">网页签到链接</label>
			<div class="col-sm-8 col-xs-12">
			{if $rid == 0}
				<p class="form-control-static">创建规则成功后显示链接</p>
			{else}
				<p class="form-control-static">{php echo $this->createMobileUrl('sign', array('rid'=>$rid))}</p><a target="_blank" class="btn btn-default" role="button" href="{$_W['siteroot']}app/{php echo $this->createMobileUrl('sign', array('rid'=>$rid))}" >打开链接</a>
			{/if}
				<span class="help-block">网页版签到不可每日多次签到<br><strong>已认证服务号</strong>可直接使用网页签到链接<br>其他公众号由于没有网页授权接口权限，不可自动获取用户信息登录，点击签到会跳转到微擎登录页，<strong>推荐使用图文消息返回方式（免登录）</strong></span>
                <p class="form-control-static">
                    {php $url=$_W['siteroot'].'app/'.$this->createMobileUrl('sign', array('rid'=>$rid))}
                    <img src="{php echo $this->createWebUrl('qrcode', array('content' => urlencode($url)))}" style="width:150px; height: 150px;">
                </p>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">是否开启积分商城推荐</label>
			<div class="col-sm-8 col-xs-12">
				<div class="input-group">
					<label class="radio-inline">
						<input type="radio" {if isset($creditmall_switch)}disabled{/if} name="base[creditmall_show]" value="1" {if $setting['base']['creditmall_show']}checked{/if}> 是
					</label>
					<label class="radio-inline">
						<input type="radio" {if isset($creditmall_switch)}disabled{/if} name="base[creditmall_show]" value="0" {if !$setting['base']['creditmall_show']}checked{/if}> 否
					</label>
				</div>
				<span class="help-block">若安装【超人】积分商城，可开启此项。开启后，网页签到轮播展示近期10条订单信息</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">网页签到规则</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				{php echo tpl_ueditor('base[sign_rule]', $setting['base']['sign_rule'])}
				<span class="help-block">网页版签到右上角签到规则的展示，可写明具体的积分赠送规则，便于提高用户签到积极性</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">未关注签到</label>
			<div class="col-sm-8 col-xs-12">
				<div class="input-group">
					<label class="radio-inline">
						<input type="radio" name="base[unsubscribe_sign]" value="1" {if isset($setting['base']['unsubscribe_sign']) && $setting['base']['unsubscribe_sign'] == 1}checked{/if} {if $_W['account']['level'] != 4}disabled{/if}> 允许
					</label>
					<label class="radio-inline">
						<input type="radio" name="base[unsubscribe_sign]" value="0" {if !isset($setting['base']['unsubscribe_sign']) || $setting['base']['unsubscribe_sign'] == 0}checked{/if} {if $_W['account']['level'] != 4}disabled{/if}> 不允许
					</label>
				</div>
				<span class="help-block">已认证服务号可设置未关注签到，未关注公众号时，自动生成会员信息保存签到积分数据</span>
			</div>
		</div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">引导关注链接</label>
            <div class="col-sm-6 col-md-8 col-xs-12">
                <input type="text" class="form-control" name="base[subscribe_url]" value="{php echo $setting['base']['subscribe_url']}" placeholder="http://" />
                <span class="help-block">不允许未关注签到时，会跳转到引导关注链接</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">是否显示签到毫秒</label>
            <div class="col-sm-8 col-xs-12">
                <div class="input-group">
                    <label class="radio-inline">
                        <input type="radio" name="base[show_millisecond]" value="1" {if isset($setting['base']['show_millisecond']) && $setting['base']['show_millisecond'] == 1}checked{/if}> 是
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="base[show_millisecond]" value="0" {if !isset($setting['base']['show_millisecond']) || $setting['base']['show_millisecond'] == 0}checked{/if}> 否
                    </label>
                </div>
                <span class="help-block">当有大量并发签到时，可开启显示签到毫秒时间，更容易区分签到时间</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">网页签到顶部背景图</label>
            <div class="col-sm-8 col-xs-12">
        		{php echo tpl_form_field_image('base[topimg]', $setting['base']['topimg'])}
        		<span class="help-block">建议采用深色背景图，推荐尺寸：360x200像素，不设置背景图时，自动获取用户头像做为背景图</span>
        	</div>
        </div>
	</div>
</div>
<div class="panel panel-default">
	<div class="panel-heading">
		积分配置
	</div>
	<div class="panel-body">
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">积分类型</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				<select name="credit[type]" class="form-control">
					<option value="">请选择</option>
					{loop $credits $key $item}
					{if $item['enabled'] == 1}
					<option value="{$key}" {if $setting['credit']['type']==$key}selected{/if}>{$item['title']}</option>
					{/if}
					{/loop}
				</select>
				<span class="help-block">签到成功赠送积分类型</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">首次签到奖励积分</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				<input type="text" class="form-control" name="credit[first]" value="{php echo $setting['credit']['first']}" />
				<span class="help-block">仅第一次签到时，奖励积分，每个签到活动分别统计，即活动一和活动二都有首次签到奖励</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">每日签到奖励积分</label>
			<div class="col-sm-6">
				<div class="input-group">
					<input placeholder="积分下限" type="text" class="form-control" name="credit[min]" value="{php echo $setting['credit']['min']}" />
					<div class="input-group-addon"> 至 </div>
					<input placeholder="积分上限" type="text" class="form-control" name="credit[max]" value="{php echo $setting['credit']['max']}" />
					<div class="input-group-addon">积分</div>
				</div>
				<span class="help-block">需要随机产生积分时，请填写下限和上限为不同的积分，反之则填写相同的积分，支持两位小数随机</span>
			</div>
		</div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">连续签到奖励</label>
            <div class="col-sm-6 col-md-8 col-xs-12">
                <div class="input-group col-sm-6">
                    <input type="text" class="form-control" name="credit[continue_limit]" value="{php echo $setting['credit']['continue_limit']}" />
                    <span class="input-group-addon">天为一个统计周期</span>
                </div>
                <span class="help-block">连续签到次数满足一个周期后，将从头开始计算</span>
            </div>
        </div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">连续签到奖励公式</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				<textarea class="form-control" rows="10" name="credit[continue_rule]" placeholder="">{php echo $setting['credit']['continue_rule']}</textarea>
				<span class="help-block">
<pre>
格式如下：
1=0
2=1
3=2
4=3
5=4
6=5
7=10
说明：1=0 第1天签到不增加连续签到奖励，2=1 第2天签到增加连续签到奖励1积分，以此类推
</pre>
				</span>
			</div>
		</div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">第一名</label>
            <div class="col-sm-6 col-md-8 col-xs-12">
                <div class="input-group col-sm-6">
                    <input type="text" class="form-control" name="credit[0]" value="{php echo $setting['credit'][0]}" />
                    <div class="input-group-addon">积分</div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">第二名</label>
            <div class="col-sm-6 col-md-8 col-xs-12">
                <div class="input-group col-sm-6">
                    <input type="text" class="form-control" name="credit[1]" value="{php echo $setting['credit'][1]}" />
                    <div class="input-group-addon">积分</div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">第三名</label>
            <div class="col-sm-6 col-md-8 col-xs-12">
                <div class="input-group col-sm-6">
                    <input type="text" class="form-control" name="credit[2]" value="{php echo $setting['credit'][2]}" />
                    <div class="input-group-addon">积分</div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">第四名</label>
            <div class="col-sm-6 col-md-8 col-xs-12">
                <div class="input-group col-sm-6">
                    <input type="text" class="form-control" name="credit[3]" value="{php echo $setting['credit'][3]}" />
                    <div class="input-group-addon">积分</div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">第五名</label>
            <div class="col-sm-6 col-md-8 col-xs-12">
                <div class="input-group col-sm-6">
                    <input type="text" class="form-control" name="credit[4]" value="{php echo $setting['credit'][4]}" />
                    <div class="input-group-addon">积分</div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">第六名</label>
            <div class="col-sm-6 col-md-8 col-xs-12">
                <div class="input-group col-sm-6">
                    <input type="text" class="form-control" name="credit[5]" value="{php echo $setting['credit'][5]}" />
                    <div class="input-group-addon">积分</div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">第七名</label>
            <div class="col-sm-6 col-md-8 col-xs-12">
                <div class="input-group col-sm-6">
                    <input type="text" class="form-control" name="credit[6]" value="{php echo $setting['credit'][6]}" />
                    <div class="input-group-addon">积分</div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">第八名</label>
            <div class="col-sm-6 col-md-8 col-xs-12">
                <div class="input-group col-sm-6">
                    <input type="text" class="form-control" name="credit[7]" value="{php echo $setting['credit'][7]}" />
                    <div class="input-group-addon">积分</div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">第九名</label>
            <div class="col-sm-6 col-md-8 col-xs-12">
                <div class="input-group col-sm-6">
                    <input type="text" class="form-control" name="credit[8]" value="{php echo $setting['credit'][8]}" />
                    <div class="input-group-addon">积分</div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label">第十名</label>
            <div class="col-sm-6 col-md-8 col-xs-12">
                <div class="input-group col-sm-6">
                    <input type="text" class="form-control" name="credit[9]" value="{php echo $setting['credit'][9]}" />
                    <div class="input-group-addon">积分</div>
                </div>
                <span class="help-block">每天签到前十名,获取额外奖励积分，积分自定义；填写就奖励，反之不奖励</span>
            </div>
        </div>
	</div>
</div>
<div class="panel panel-default">
	<div class="panel-heading">
		广告/赞助商设置
	</div>
	<div class="panel-body">
		<div class="alert alert-danger">网页版签到暂不支持广告展示</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">广告位置</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				<div class="input-group">
					<label class="radio-inline">
						<input type="radio" name="ad[position]" value="top" {if $setting['ad']['position']=='top'}checked{/if}> 排行榜顶部
					</label>
					<label class="radio-inline">
						<input type="radio" name="ad[position]" value="bottom" {if $setting['ad']['position']=='bottom'}checked{/if}> 排行榜底部
					</label>
					<span class="help-block">广告位位于签到排行榜页面，当设置广告内容后，自动展示广告内容</span>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">广告内容</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				{php echo tpl_ueditor('ad[content]', $setting['ad']['content'])}
			</div>
		</div>
	</div>
</div>
<div class="panel panel-default">
	<div class="panel-heading">
		回复内容配置
	</div>
	<div class="panel-body">
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">提示语变量</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				<span id="super_var_wrap" class="help-block">
					<strong>{##reward##}</strong> 表示签到获得的奖励 <a data-content="{##reward##}" href="javascript:;" title="点击复制">点击复制</a><br/>
					<strong>{##extra_reward##}</strong> 表示签到获得的额外奖励 <a data-content="{##extra_reward##}" href="javascript:;" title="点击复制">点击复制</a><br/>
					<strong>{##total##}</strong> 表示签到总次数 <a data-content="{##total##}" href="javascript:;" title="点击复制">点击复制</a><br/>
					<strong>{##today_total##}</strong> 表示今天签到次数 <a data-content="{##today_total##}" href="javascript:;" title="点击复制">点击复制</a><br/>
					<strong>{##continue_total##}</strong> 表示连续签到次数 <a data-content="{##continue_total##}" href="javascript:;" title="点击复制">点击复制</a><br/>
					<strong>{##time##}</strong> 表示签到时间 <a data-content="{##time##}" href="javascript:;" title="点击复制">点击复制</a><br/>
					<strong>{##rankurl##}</strong> 表示签到排行榜 <a data-content="{##rankurl##}" href="javascript:;" title="点击复制">点击复制</a><br/>
					<strong>{##credit_total##}</strong> 表示总积分 <a data-content="{##credit_total##}" href="javascript:;" title="点击复制">点击复制</a><br/>
					<strong>{##lucky_code##}</strong> 表示幸运码 <a data-content="{##lucky_code##}" href="javascript:;" title="点击复制">点击复制</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;未开启幸运码开关时不要写此变量<br/>
					<strong>{##shareurl##}</strong> 表示邀请签到链接 <a data-content="{##shareurl##}" href="javascript:;" title="点击复制">点击复制</a>&nbsp;&nbsp;&nbsp;使用此变量前确认参数设置已设置成功<br/>
				</span>
				<script>
					require(['jquery', 'util'], function($, u){
						$('#super_var_wrap a').each(function(){
							u.clip(this, $(this).attr('data-content'));
						});
					});
				</script>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">签到回复语</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				<div class="input-group">
					<label class="radio-inline">
						<input type="radio" class="mode" name="reply[mode]" value="text" {if $reply['mode'] == 'text' || $setting['reply']['mode'] ==''}checked{/if}> 文字
					</label>
					<label class="radio-inline">
						<input type="radio" class="mode" name="reply[mode]" value="news" {if $reply['mode'] == 'news'}checked{/if}> 图文
					</label>
				</div>
				<span class="help-block"></span>
			</div>
		</div>

		<div class="news" {if $reply['mode'] == 'text' || $reply['mode'] == ''}hidden{/if}>
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">签到成功</label>
			<div class="form-group">
				<div class="col-sm-6 col-md-8 col-xs-12" style="background-color: #f5f5f5;border: 1px solid #ccc;border-radius: 4px;margin-bottom: 10px;">
					<fieldset>
						<legend style="font-size: 16px;line-height: 36px;padding-left: 10px;">图文1</legend>
						<span class="help-block">图文1为必填。</span>
						<div class="form-group">
							<label class="col-xs-12 col-sm-2 col-md-2 control-label">标题</label>
							<div class="col-sm-6 col-md-8 col-xs-12">
								<input type="text" placeholder="请输入图文消息标题" class="form-control" name="reply[news_title1]" value="{php echo $reply['news_title1']}" />
								<span class="help-block"></span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-sm-2 col-md-2 control-label">封面</label>
							<div class="col-sm-6 col-md-8 col-xs-12">
								{php echo tpl_form_field_image('reply[news_imgurl1]', $reply['news_imgurl1'])}
								<span class="help-block">推荐尺寸为360*200</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-sm-2 col-md-2 control-label">描述</label>
							<div class="col-sm-6 col-md-8 col-xs-12">
								<textarea name="reply[news_comment]" class="form-control">{php echo $reply['news_comment']}</textarea>
								<span class="help-block">图文2不为空时，图文1描述将不显示，请将描述内容放至标题</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-sm-2 col-md-2 control-label">来源</label>
							<div class="col-sm-6 col-md-8 col-xs-12">
								<input type="text" placeholder="请输入图文消息链接，可写签到排行榜和邀请签到链接变量" class="form-control" name="reply[news_url1]" value="{php echo $reply['news_url1']}" />
								<span class="help-block">请输入图文消息1的链接（链接带http://），可写签到排行榜和邀请签到链接变量</span>
							</div>
						</div>
					</fieldset>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 control-label"></label>
				<div class="col-sm-6 col-md-8 col-xs-12" style="background-color: #f5f5f5;border: 1px solid #ccc;border-radius: 4px;margin-bottom: 10px;">
				<fieldset>
					<legend style="font-size: 16px;line-height: 36px;padding-left: 10px;">图文2</legend>
					<span class="help-block">图文2为选填，推荐填写分享页标题和链接，图文2若全部留空，则显示图文1的单图文消息</span>
					<div class="form-group">
						<label class="col-xs-12 col-sm-2 col-md-2 control-label">标题</label>
						<div class="col-sm-6 col-md-8 col-xs-12">
							<input type="text" placeholder="请输入图文2标题" class="form-control" name="reply[news_title2]" value="{php echo $reply['news_title2']}" />
							<span class="help-block"></span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-xs-12 col-sm-2 col-md-2 control-label">封面</label>
						<div class="col-sm-6 col-md-8 col-xs-12">
							{php echo tpl_form_field_image('reply[news_imgurl2]', $reply['news_imgurl2'])}
							<span class="help-block">推荐尺寸为200*200</span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-xs-12 col-sm-2 col-md-2 control-label">来源</label>
						<div class="col-sm-6 col-md-8 col-xs-12">
							<input type="text" placeholder="请输入图文2的链接，可写签到排行榜和邀请签到链接变量" class="form-control" name="reply[news_url2]" value="{php echo $reply['news_url2']}" />
							<span class="help-block">请输入图文消息2的链接（链接带http://），可写签到排行榜和邀请签到链接变量</span>
						</div>
					</div>
				</fieldset>
			</div>
		</div>
            <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label"></label>
            <div class="col-sm-6 col-md-8 col-xs-12" style="background-color: #f5f5f5;border: 1px solid #ccc;border-radius: 4px;margin-bottom: 10px;">
                <fieldset>
                    <legend style="font-size: 16px;line-height: 36px;padding-left: 10px;">图文3</legend>
                    <span class="help-block">图文3为选填，推荐填写分享页标题和链接，图文3若全部留空，则不显示图文消息</span>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 control-label">标题</label>
                        <div class="col-sm-6 col-md-8 col-xs-12">
                            <input type="text" placeholder="请输入图文3标题" class="form-control" name="reply[news_title3]" value="{php echo $reply['news_title3']}" />
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 control-label">封面</label>
                        <div class="col-sm-6 col-md-8 col-xs-12">
                            {php echo tpl_form_field_image('reply[news_imgurl3]', $reply['news_imgurl3'])}
                            <span class="help-block">推荐尺寸为200*200</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 control-label">来源</label>
                        <div class="col-sm-6 col-md-8 col-xs-12">
                            <input type="text" placeholder="请输入图文3的链接，可写签到排行榜和邀请签到链接变量" class="form-control" name="reply[news_url3]" value="{php echo $reply['news_url3']}" />
                            <span class="help-block">请输入图文消息3的链接（链接带http://），可写签到排行榜和邀请签到链接变量</span>
                        </div>
                    </div>
                </fieldset>
            </div>
        </div>
            <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label"></label>
            <div class="col-sm-6 col-md-8 col-xs-12" style="background-color: #f5f5f5;border: 1px solid #ccc;border-radius: 4px;margin-bottom: 10px;">
                <fieldset>
                    <legend style="font-size: 16px;line-height: 36px;padding-left: 10px;">图文4</legend>
                    <span class="help-block">图文4为选填，推荐填写分享页标题和链接，图文4若全部留空，则不显示图文消息</span>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 control-label">标题</label>
                        <div class="col-sm-6 col-md-8 col-xs-12">
                            <input type="text" placeholder="请输入图文4标题" class="form-control" name="reply[news_title4]" value="{php echo $reply['news_title4']}" />
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 control-label">封面</label>
                        <div class="col-sm-6 col-md-8 col-xs-12">
                            {php echo tpl_form_field_image('reply[news_imgurl4]', $reply['news_imgurl4'])}
                            <span class="help-block">推荐尺寸为200*200</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 control-label">来源</label>
                        <div class="col-sm-6 col-md-8 col-xs-12">
                            <input type="text" placeholder="请输入图文4的链接，可写签到排行榜和邀请签到链接变量" class="form-control" name="reply[news_url4]" value="{php echo $reply['news_url4']}" />
                            <span class="help-block">请输入图文消息4的链接（链接带http://），可写签到排行榜和邀请签到链接变量</span>
                        </div>
                    </div>
                </fieldset>
            </div>
        </div>
            <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 control-label"></label>
            <div class="col-sm-6 col-md-8 col-xs-12" style="background-color: #f5f5f5;border: 1px solid #ccc;border-radius: 4px;margin-bottom: 10px;">
                <fieldset>
                    <legend style="font-size: 16px;line-height: 36px;padding-left: 10px;">图文5</legend>
                    <span class="help-block">图文5为选填，推荐填写分享页标题和链接，图文5若全部留空，则不显示图文消息</span>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 control-label">标题</label>
                        <div class="col-sm-6 col-md-8 col-xs-12">
                            <input type="text" placeholder="请输入图文5标题" class="form-control" name="reply[news_title5]" value="{php echo $reply['news_title5']}" />
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 control-label">封面</label>
                        <div class="col-sm-6 col-md-8 col-xs-12">
                            {php echo tpl_form_field_image('reply[news_imgurl5]', $reply['news_imgurl5'])}
                            <span class="help-block">推荐尺寸为200*200</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 control-label">来源</label>
                        <div class="col-sm-6 col-md-8 col-xs-12">
                            <input type="text" placeholder="请输入图文5的链接，可写签到排行榜和邀请签到链接变量" class="form-control" name="reply[news_url5]" value="{php echo $reply['news_url5']}" />
                            <span class="help-block">请输入图文消息5的链接（链接带http://），可写签到排行榜和邀请签到链接变量</span>
                        </div>
                    </div>
                </fieldset>
            </div>
        </div>
    </div>
		<script type="text/javascript">
			require(['jquery', 'util'], function($, u){
				$('input.mode').click(function(){
					var mode = $(this).val();
					if (mode == 'news') {
						$('.news').show();
						$('.text').hide();
					}
					if (mode == 'text') {
						$('.news').hide();
						$('.text').show();
					}
				});
			});
		</script>
		<div class="form-group text" {if $reply['mode'] == 'news'}hidden{/if}>
			<label class="col-xs-12 col-sm-2 col-md-2 control-label">签到成功提示语</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				<textarea class="form-control" rows="8" name="reply[success]" placeholder="">{php echo $reply['success']}</textarea>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">签到失败提示语</label>
			<div class="col-sm-6 col-md-8 col-xs-12">
				<textarea class="form-control" rows="8" name="reply[fail]" placeholder="">{php echo $reply['fail']}</textarea>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
function validateReplyForm(formobj, jq, underscore, util, $scope, $http) {
    //base
	if (jq('input[name="base[sign_count]"]').val() < 0) {
		util.message('请输入签到次数');
		return false;
	}
    if (jq('input[name="base[start]"]').val() > 23 || jq('input[name="base[start]"]').val() < 0) {
		util.message('请输入合法的签到开始时间');
		return false;
	}
    if (jq('input[name="base[end]"]').val() > 23 || jq('input[name="base[end]"]').val() < 0) {
		util.message('请输入合法的签到结束时间');
		return false;
	}
    if (jq('input[name="base[luckycode]"]:checked').val() == 1 && !jq('input[name="base[luckystart]"]').val()) {
		util.message('请输入幸运码初始值');
		return false;
	}
	//--end

	//reply
    if (jq('input[name="reply[reply]"]').val() == '') {
        util.message('请输入签到失败提示语');
        return false;
    }
    //--end

    //credit
    if (jq('input[name="credit[min]"]').val() <= 0 || jq('input[name="credit[max]"]').val() <= 0) {
        util.message('请输入签到奖励积分');
        return false;
    }
    //--end
    return true;
}
</script>